function varerr(time,y,a,m,b,yic,Y)

load('orthbase');
load('mcpart');

%exactvar=1/4*mcpart+1/2*time.^2'; %BMBM
%exactvar=1/4*mcpart+3/2*time'+1/4*(exp(-2*time)-1)';%%BMOU
%exactvar=4*time';
%exactvar=1/2*(exp(2*time)-1)';
%exactvar=time/2-1/4*sin(2*time);
if a==0
exactvar=time';
else
exactvar=b^2/2/a*(1-exp(-2*a*time))'+(m+(yic-m)*exp(-a*time)).^2';    
end
hold on
plot(time,exactvar);
tmp=zeros(size(y(:,1)));
for ii=1:size(Y,2)
    %tmp=tmp+Y(:,ii).*Y(:,ii);
    tmp=tmp+Y(:,ii);
end
tmp=sum(Y,2);
plot(time,tmp,'k-');
title('Variance')
legend('exact var','wce var');
